<?php
_import("HeadCol.php");

class IndexController extends BaseController {
	public function _before_indexAction() {
		echo "test before function";
		exit(0);
	}
	
	public function indexAction($params){
		if( $this->assert($params["msg"])) {
			$this->assign("msg", $params["msg"]);
		}
		$this->display("home/index.html");
	}
	
	public function adminAction() {
		// $headCol = new HeadCol();
		// $mobileHead = $headCol->getMobileHead();
		// $data = explode(":", $mobileHead);
		// _print($data);
		$this->display("admin/login.html");
	}
	
	public function adminIndexAction() {
		$menu = array(
			"汽配查询"=>array(
					"车型查询"=>array(
							'刹车片查询'=>array("rel"=>"w_modelSearch", "href"=>"/index.php?c=Part&a=modelSearch&t=t_brade&typeId=1"),
							'火花塞查询'=>array("rel"=>"w_modelSearch", "href"=>"/index.php?c=Part&a=modelSearch&t=t_spark&typeId=2"),
							'滤清器查询'=>array("rel"=>"w_modelSearch", "href"=>"/index.php?c=Part&a=modelSearch&t=t_filter&typeId=3"),
							'雨刮片查询'=>array("rel"=>"w_modelSearch", "href"=>"/index.php?c=Part&a=modelSearch&t=t_washer&typeId=4"),
	
					),
					"编码查询"=>array(
							'系统编码查询' =>array("rel"=>"w_codeSearch", "href"=>"/index.php?c=Part&a=codeSearch"),
					),
			),
			"常用功能"=>array(
					"友情链接"=>array(
							'链接名1'=>array("rel"=>"", "href"=>"http://www.baidu.com"),
							'链接名2'=>array("rel"=>"", "href"=>"http://nba.hupu.com"),
							'管理链接'=>array("rel"=>"", "href"=>""),
					),
					"编码转换"=>array(
							'编码转换查询' =>array("rel"=>"w_table", "href"=>"/index.php?c=Search&a=searchCode"),
	
					),
					"图片查看"=>array(
							'图片对比' =>array("rel"=>"w_compare", "href"=>"/index.php?c=Autopart&a=pictureinfo"),
							'图片上传' =>array("rel"=>"w_upload", "href"=>"/tpl/w_upload.html"),
					),
			),
			"用户管理"=>array(
					"用户管理"=>array(
							'添加管理员'=>array("rel"=>"", "href"=>""),
							'修改密码'=>array("rel"=>"", "href"=>"/tpl/admin/modifypasswd.html"),
					),
					"权限管理"=>array(
							'用户权限设置'=>array("rel"=>"", "href"=>""),
							'权限规则设置'=>array("rel"=>"", "href"=>""),
					),
			),
			"数据管理"=>array(
					"汽配数据导入"=>array(
							'刹车片数据导入'=>array("rel"=>"", "href"=>""),
							'雨刮片数据导入'=>array("rel"=>"", "href"=>""),
							'滤清器数据导入'=>array("rel"=>"", "href"=>""),
							'火花塞数据导入'=>array("rel"=>"", "href"=>""),
					),
					"车型数据导入"=>array(
							'车型数据导入'=>array("rel"=>"", "href"=>""),
					),
					"测试页面"=>array(
							'测试页面'=>array("rel"=>"", "href"=>"/index.php?c=DataManager&a=importBrade"),
							'清空测试'=>array("rel"=>"", "href"=>"/index.php?c=DataManager&a=clearTest"),
					),
			),
		);
		// echo(urldecode(json_encode($menu)));
		$this->assign('menu', $menu);
		$this->display('admin/index.html');
	}
	
	public function registerAction() {
		_step("haha");
	}
}